package net.fdukedom.epicurus.presentation.actions.install;

import net.fdukedom.epicurus.presentation.actions.AbstractAction;
import net.fdukedom.epicurus.domain.install.InstallHelper;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * @author Dmitry Y. Kochelaev
 */
public class InstallAction extends AbstractAction<InstallForm> {

    protected ActionForward doExecute(ActionMapping mapping, InstallForm form, HttpServletRequest request, HttpServletResponse response) {
        InstallHelper.getInstance().install(form.getRootLogin(), form.getRootEmail(), form.getRootPassword());
        return mapping.findForward("success");
    }
}
